package com.neal.conf;

import com.neal.domain.User;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Neal
 * @createdDate 2014-5-26
 */
@Configuration
public class RepositoryConfig {

    @Value("${jdbc.driverClassName}")
    private String driverClassName;

    @Value("${jdbc.url}")
    private String url;

    @Value("${jdbc.username}")
    private String username;

    @Value("${jdbc.password}")
    private String password;

    @Value("${hibernate.dialect}")
    private String hibernateDialect;

    @Value("${hibernate.show_sql}")
    private String hibernateShowSql;

    @Value("${hibernate.hbm2ddl.auto}")
    private String hibernateHbm2ddlAuto;
    
    
    @Bean
    public User getUser(){
        StringBuilder sb = new StringBuilder();
        sb.append(driverClassName).append(url).append(username).append(password).append(hibernateDialect);
        System.out.println(sb.toString());
        return new User();
    }

}
